<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
    <div class="col-sm-12 select-info">
				<form id="post-form">
					<div class="select-list">
						<ul>
							<li class="select-time">
								<label>时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>
							<li>
								报餐人：<input type="text" name="userName"/>
							</li>
							<li>
								餐别：<select name="aroundType" th:with="type=${@dict.getType('dinner_type')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:post:export"><i class="fa fa-download"></i>&nbsp;导出</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('module:aroundDinner:edit')}]];
        var removeFlag = [[${@permission.hasPermi('module:aroundDinner:remove')}]];
        var dinnerType = [[${@dict.getType('dinner_type')}]];
        var prefix = ctx + "statistic/aroundDinner"

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/exportAroundDinner",
                search: false,
		        showExport: false,
                modalName: "围餐明细",
                columns: [{
					field : 'aroundDate', 
					title : '日期' 
				},
				{
					field : 'aroundType', 
					title : '餐别' ,
					 formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(dinnerType, value);
		            }
				},
				{
					field : 'aroundCount', 
					title : '人数' 
				},
				{
					field : 'aroundPersion', 
					title : '用餐人员' 
				},
				{
					field : 'aroundReq', 
					title : '要求菜品' 
				},
				{
					field : 'aroundOtherReq', 
					title : '其他要求' 
				},
				{
					field : 'userName', 
					title : '报餐人' 
				},
				{
					field : 'aroundStartDate', 
					title : '报餐日期' 
				}
		        ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>